<template>
  <div class="weui-cell">
    <div class="weui-cell__bd">{{device.lable}}</div>
    <div class="weui-cell__ft"><button class="weui-btn mini-btn" type="primary" size="mini" @click="action">{{device.lable}}</button></div>
  </div>
</template>

<script>
import { publishMessage } from "@/utils";
export default {
  name: "mpvue-button",
  data() {
    return {};
  },
  props: {
    device: Object
    // {
    //   type: "button",
    //   lable: "LED",
    //   key:'LED',
    //   value: 1
    // },
  },
  mounted() {
    // console.log("111111", this.device);
  },
  methods: {
    action() {
      publishMessage(`{"${this.device.key}":0}`);
    }
  }
};
</script>

<style>
</style>
